package com.cheng.student.dao.mappers;

import com.cheng.student.beans.Teacher;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TeacherMapper
    extends Transaction
{
    //查询老师信息
    public Teacher selectTeacher(
            @Param("payrollNumber")String payrollNumber,
            @Param("password")String password);
    //分页查询老师
    public List<Teacher> selectTeachers(
            @Param("start")int start,
            @Param("rows")int rows
    );
    //查询老师总数
    public int selectNumberOfTeachers();
    //更新姓名
    public void updateNameByPassword(
            @Param("payrollNumber")String payrollNumber,
            @Param("password")String password,
            @Param("newName")String newName);
    public void updateNameByName(
            @Param("payrollNumber")String payrollNumber,
            @Param("name")String name,
            @Param("newName")String newName);
    //更新密码
    public void updatePasswordByPassword(
            @Param("payrollNumber")String payrollNumber,
            @Param("password")String password,
            @Param("newPassword")String newPassword
    );

    public void updatePasswordByName(
            @Param("payrollNumber")String payrollNumber,
            @Param("name")String name,
            @Param("newPassword")String newPassword
    );

    //更新图片路径
    public void updatePath(
            @Param("payrollNumber")String payrollNumber,
            @Param("password")String password,
            @Param("path")String newPath);

    //添加老师
    public void insertTeacher(
            @Param("name")String name,
            @Param("payrollNumber")String payrollNumber,
            @Param("password")String password,
            @Param("headPortraitPath")String path
    );

    //删除老师
    public void deleteTeacher(
            @Param("name")String name,
            @Param("payrollNumber")String payrollNumber
    );

}
